/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package edu.cmu.cs.webapp.ioms.models.impl;

import edu.cmu.cs.webapp.ioms.models.Client;
import edu.cmu.cs.webapp.ioms.models.IOMSPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Client</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link edu.cmu.cs.webapp.ioms.models.impl.ClientImpl#getClient_id <em>Client id</em>}</li>
 *   <li>{@link edu.cmu.cs.webapp.ioms.models.impl.ClientImpl#getLname <em>Lname</em>}</li>
 *   <li>{@link edu.cmu.cs.webapp.ioms.models.impl.ClientImpl#getFname <em>Fname</em>}</li>
 *   <li>{@link edu.cmu.cs.webapp.ioms.models.impl.ClientImpl#getEmail <em>Email</em>}</li>
 *   <li>{@link edu.cmu.cs.webapp.ioms.models.impl.ClientImpl#getPhone <em>Phone</em>}</li>
 *   <li>{@link edu.cmu.cs.webapp.ioms.models.impl.ClientImpl#getCompany <em>Company</em>}</li>
 *   <li>{@link edu.cmu.cs.webapp.ioms.models.impl.ClientImpl#getAddress <em>Address</em>}</li>
 *   <li>{@link edu.cmu.cs.webapp.ioms.models.impl.ClientImpl#getCity <em>City</em>}</li>
 *   <li>{@link edu.cmu.cs.webapp.ioms.models.impl.ClientImpl#getState <em>State</em>}</li>
 *   <li>{@link edu.cmu.cs.webapp.ioms.models.impl.ClientImpl#getCountry <em>Country</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ClientImpl extends EObjectImpl implements Client {
	/**
	 * The default value of the '{@link #getClient_id() <em>Client id</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getClient_id()
	 * @generated
	 * @ordered
	 */
	protected static final int CLIENT_ID_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getClient_id() <em>Client id</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getClient_id()
	 * @generated
	 * @ordered
	 */
	protected int client_id = CLIENT_ID_EDEFAULT;

	/**
	 * The default value of the '{@link #getLname() <em>Lname</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLname()
	 * @generated
	 * @ordered
	 */
	protected static final String LNAME_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getLname() <em>Lname</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLname()
	 * @generated
	 * @ordered
	 */
	protected String lname = LNAME_EDEFAULT;

	/**
	 * The default value of the '{@link #getFname() <em>Fname</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getFname()
	 * @generated
	 * @ordered
	 */
	protected static final String FNAME_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getFname() <em>Fname</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getFname()
	 * @generated
	 * @ordered
	 */
	protected String fname = FNAME_EDEFAULT;

	/**
	 * The default value of the '{@link #getEmail() <em>Email</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getEmail()
	 * @generated
	 * @ordered
	 */
	protected static final String EMAIL_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getEmail() <em>Email</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getEmail()
	 * @generated
	 * @ordered
	 */
	protected String email = EMAIL_EDEFAULT;

	/**
	 * The default value of the '{@link #getPhone() <em>Phone</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPhone()
	 * @generated
	 * @ordered
	 */
	protected static final String PHONE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getPhone() <em>Phone</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPhone()
	 * @generated
	 * @ordered
	 */
	protected String phone = PHONE_EDEFAULT;

	/**
	 * The default value of the '{@link #getCompany() <em>Company</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCompany()
	 * @generated
	 * @ordered
	 */
	protected static final String COMPANY_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getCompany() <em>Company</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCompany()
	 * @generated
	 * @ordered
	 */
	protected String company = COMPANY_EDEFAULT;

	/**
	 * The default value of the '{@link #getAddress() <em>Address</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getAddress()
	 * @generated
	 * @ordered
	 */
	protected static final String ADDRESS_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getAddress() <em>Address</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getAddress()
	 * @generated
	 * @ordered
	 */
	protected String address = ADDRESS_EDEFAULT;

	/**
	 * The default value of the '{@link #getCity() <em>City</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCity()
	 * @generated
	 * @ordered
	 */
	protected static final String CITY_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getCity() <em>City</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCity()
	 * @generated
	 * @ordered
	 */
	protected String city = CITY_EDEFAULT;

	/**
	 * The default value of the '{@link #getState() <em>State</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getState()
	 * @generated
	 * @ordered
	 */
	protected static final String STATE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getState() <em>State</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getState()
	 * @generated
	 * @ordered
	 */
	protected String state = STATE_EDEFAULT;

	/**
	 * The default value of the '{@link #getCountry() <em>Country</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCountry()
	 * @generated
	 * @ordered
	 */
	protected static final String COUNTRY_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getCountry() <em>Country</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCountry()
	 * @generated
	 * @ordered
	 */
	protected String country = COUNTRY_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected ClientImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return IOMSPackage.Literals.CLIENT;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getClient_id() {
		return client_id;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setClient_id(int newClient_id) {
		int oldClient_id = client_id;
		client_id = newClient_id;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, IOMSPackage.CLIENT__CLIENT_ID, oldClient_id, client_id));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getLname() {
		return lname;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setLname(String newLname) {
		String oldLname = lname;
		lname = newLname;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, IOMSPackage.CLIENT__LNAME, oldLname, lname));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getFname() {
		return fname;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setFname(String newFname) {
		String oldFname = fname;
		fname = newFname;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, IOMSPackage.CLIENT__FNAME, oldFname, fname));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getEmail() {
		return email;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setEmail(String newEmail) {
		String oldEmail = email;
		email = newEmail;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, IOMSPackage.CLIENT__EMAIL, oldEmail, email));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getPhone() {
		return phone;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setPhone(String newPhone) {
		String oldPhone = phone;
		phone = newPhone;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, IOMSPackage.CLIENT__PHONE, oldPhone, phone));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getCompany() {
		return company;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setCompany(String newCompany) {
		String oldCompany = company;
		company = newCompany;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, IOMSPackage.CLIENT__COMPANY, oldCompany, company));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getAddress() {
		return address;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setAddress(String newAddress) {
		String oldAddress = address;
		address = newAddress;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, IOMSPackage.CLIENT__ADDRESS, oldAddress, address));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getCity() {
		return city;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setCity(String newCity) {
		String oldCity = city;
		city = newCity;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, IOMSPackage.CLIENT__CITY, oldCity, city));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getState() {
		return state;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setState(String newState) {
		String oldState = state;
		state = newState;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, IOMSPackage.CLIENT__STATE, oldState, state));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getCountry() {
		return country;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setCountry(String newCountry) {
		String oldCountry = country;
		country = newCountry;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, IOMSPackage.CLIENT__COUNTRY, oldCountry, country));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case IOMSPackage.CLIENT__CLIENT_ID:
				return getClient_id();
			case IOMSPackage.CLIENT__LNAME:
				return getLname();
			case IOMSPackage.CLIENT__FNAME:
				return getFname();
			case IOMSPackage.CLIENT__EMAIL:
				return getEmail();
			case IOMSPackage.CLIENT__PHONE:
				return getPhone();
			case IOMSPackage.CLIENT__COMPANY:
				return getCompany();
			case IOMSPackage.CLIENT__ADDRESS:
				return getAddress();
			case IOMSPackage.CLIENT__CITY:
				return getCity();
			case IOMSPackage.CLIENT__STATE:
				return getState();
			case IOMSPackage.CLIENT__COUNTRY:
				return getCountry();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case IOMSPackage.CLIENT__CLIENT_ID:
				setClient_id((Integer)newValue);
				return;
			case IOMSPackage.CLIENT__LNAME:
				setLname((String)newValue);
				return;
			case IOMSPackage.CLIENT__FNAME:
				setFname((String)newValue);
				return;
			case IOMSPackage.CLIENT__EMAIL:
				setEmail((String)newValue);
				return;
			case IOMSPackage.CLIENT__PHONE:
				setPhone((String)newValue);
				return;
			case IOMSPackage.CLIENT__COMPANY:
				setCompany((String)newValue);
				return;
			case IOMSPackage.CLIENT__ADDRESS:
				setAddress((String)newValue);
				return;
			case IOMSPackage.CLIENT__CITY:
				setCity((String)newValue);
				return;
			case IOMSPackage.CLIENT__STATE:
				setState((String)newValue);
				return;
			case IOMSPackage.CLIENT__COUNTRY:
				setCountry((String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case IOMSPackage.CLIENT__CLIENT_ID:
				setClient_id(CLIENT_ID_EDEFAULT);
				return;
			case IOMSPackage.CLIENT__LNAME:
				setLname(LNAME_EDEFAULT);
				return;
			case IOMSPackage.CLIENT__FNAME:
				setFname(FNAME_EDEFAULT);
				return;
			case IOMSPackage.CLIENT__EMAIL:
				setEmail(EMAIL_EDEFAULT);
				return;
			case IOMSPackage.CLIENT__PHONE:
				setPhone(PHONE_EDEFAULT);
				return;
			case IOMSPackage.CLIENT__COMPANY:
				setCompany(COMPANY_EDEFAULT);
				return;
			case IOMSPackage.CLIENT__ADDRESS:
				setAddress(ADDRESS_EDEFAULT);
				return;
			case IOMSPackage.CLIENT__CITY:
				setCity(CITY_EDEFAULT);
				return;
			case IOMSPackage.CLIENT__STATE:
				setState(STATE_EDEFAULT);
				return;
			case IOMSPackage.CLIENT__COUNTRY:
				setCountry(COUNTRY_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case IOMSPackage.CLIENT__CLIENT_ID:
				return client_id != CLIENT_ID_EDEFAULT;
			case IOMSPackage.CLIENT__LNAME:
				return LNAME_EDEFAULT == null ? lname != null : !LNAME_EDEFAULT.equals(lname);
			case IOMSPackage.CLIENT__FNAME:
				return FNAME_EDEFAULT == null ? fname != null : !FNAME_EDEFAULT.equals(fname);
			case IOMSPackage.CLIENT__EMAIL:
				return EMAIL_EDEFAULT == null ? email != null : !EMAIL_EDEFAULT.equals(email);
			case IOMSPackage.CLIENT__PHONE:
				return PHONE_EDEFAULT == null ? phone != null : !PHONE_EDEFAULT.equals(phone);
			case IOMSPackage.CLIENT__COMPANY:
				return COMPANY_EDEFAULT == null ? company != null : !COMPANY_EDEFAULT.equals(company);
			case IOMSPackage.CLIENT__ADDRESS:
				return ADDRESS_EDEFAULT == null ? address != null : !ADDRESS_EDEFAULT.equals(address);
			case IOMSPackage.CLIENT__CITY:
				return CITY_EDEFAULT == null ? city != null : !CITY_EDEFAULT.equals(city);
			case IOMSPackage.CLIENT__STATE:
				return STATE_EDEFAULT == null ? state != null : !STATE_EDEFAULT.equals(state);
			case IOMSPackage.CLIENT__COUNTRY:
				return COUNTRY_EDEFAULT == null ? country != null : !COUNTRY_EDEFAULT.equals(country);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (client_id: ");
		result.append(client_id);
		result.append(", lname: ");
		result.append(lname);
		result.append(", fname: ");
		result.append(fname);
		result.append(", email: ");
		result.append(email);
		result.append(", phone: ");
		result.append(phone);
		result.append(", company: ");
		result.append(company);
		result.append(", address: ");
		result.append(address);
		result.append(", city: ");
		result.append(city);
		result.append(", state: ");
		result.append(state);
		result.append(", country: ");
		result.append(country);
		result.append(')');
		return result.toString();
	}

} //ClientImpl
